﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GenCallDB
{
	public class ActiveLicenses
	{
		private int[] _bitMap;

		public ActiveLicenses()
		{
			_bitMap = new int[ 256000 ];
		}

		public bool this[ int id ]
		{
			get
			{
				int
					index = id / 32,
					mask = ( 1 << ( id % 32 ) );

				return ( _bitMap[ index ] & mask ) == mask;
			}
			set
			{
				int
					index = id / 32,
					mask = ( 1 << ( id % 32 ) );

				if ( value )
					_bitMap[ index ] |= mask;
				else
					_bitMap[ index ] &= ~mask;
			}
		}
	}
}
